package com.buba.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.buba.mapper.AdjustmentRecordMapper;
import com.buba.service.AdjustmentRecordService;
import entity.salary.AdjustmentRecord;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author beisheng
 * @since 2023-03-21
 */
@Service
public class AdjustmentRecordServiceImpl extends ServiceImpl<AdjustmentRecordMapper, AdjustmentRecord> implements AdjustmentRecordService {

    @Resource
    private AdjustmentRecordMapper adjustmentRecordMapper;

    /* *
     * @Author: beisheng
     * @Descriprion: 根据人员ID查询调整记录
     * @Date: 2023/3/21 19:34
     * @Return: common.R
     * @Param: [accId]
     */

    @Override
    public List<AdjustmentRecord> selAdjustByAccId(Integer accId) {
        List<AdjustmentRecord> adjustmentRecords = adjustmentRecordMapper.selectList(new QueryWrapper<AdjustmentRecord>().eq("acc_id", accId).orderByDesc("create_time"));
        return adjustmentRecords;
    }
}
